package com.bank.bank.account.mapper;

import com.bank.bank.common.base.pojo.entity.Account;
import com.bank.bank.common.base.pojo.vo.AccountTransactionVO;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/*@Mapper*/
public interface AccountMapper {

    int insertAccount(Account account);

    List<Account> selectAllAccount();

    int deleteAccountById(Long accountId);

    AccountTransactionVO selectAccountTransactionByAccountId(Integer accountId);
    @Select("select * from account where customer_id=#{customerId}")
    List<Account> selectCustomerAccount(Integer customerId);
    @Select("select * from account where id=#{id}")
    Account selectAccountById(Integer accountId);
    @Update("update account set balance=#{balance} where id=#{id}")
    void updateAccountBalance(Account account);
}
